import Vue from 'vue'
import VueRouter from 'vue-router'
import Films from '../views/Films'
import City from '../views/Films/City.vue'
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/films/hot'
  },
  {
    path: '/films',
    name: 'Films',
    component: Films,
    meta: {
      isNav: true
    },
    children: [
      {
        path: 'hot',
        component: ()=>import('../views/Films/Hot.vue'),
        meta: {
          isNav: true
        }
      },
      {
        path: 'coming',
        component: ()=>import('../views/Films/Coming.vue'),
        meta: {
          isNav: true
        }
      }
    ]
  },
  {
    path: '/city',
    name: 'City',
    component: City,
  },
  {
    path: '/article',
    name: 'Article',
    component: () => import('../views/Article'),
    meta: {
      isNav: true
    }
  }, {
    path: '/center',
    name: "Center",
    component: () => import('../views/Center'),
    meta: {
      isNav: true
    }
  }, {
    path: '/movieDetail/:id',
    name: "MovieDetail",
    component: () => import('../views/Films/MovieDetail.vue')
  }, {
    path: '/comingDetail/:id',
    name: "comingDetail",
    component: () => import('../views/Films/comingDetail.vue')
  }, {
    path: '/articleDetail/:id',
    name: "ArticleDetail",
    component: () => import('../views/Article/ArticleDetail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
